<div  ng-include="'partials/common/crumb/crumb.html'"></div>
<div id="vote" ng-controller="voteCtrl" ng-init="init()">

<div class="voteheader">
    <div class="titleitem letin "  ng-class=" {'active':letin}" ng-click="letinchange()">{{'DELEGATE_LIST' | translate}}</div>
    <div class="titleitem mgvotecord"  ng-class=" {'active':mgvotecord}" ng-click="mgvotecordchange()">{{'VOTE_RECORD' | translate}}</div>
    <div class="titleitem hosting"  ng-class=" {'active':hosting}" ng-click="hostingchange()">{{'MY_VOTERS' | translate}}</div>
</div>
    <div class="content first" ng-show="letin">
        <div class="innerheader">
            <span translate="TOTAL_PEOPLES" translate-values="{ count: delegateCount }"></span>
            <!--<input class="search" type="text">-->
            <button ng-click="votetoShowInfo()">{{'VOTE' | translate}}</button>
        </div>
        <div class="tablewrap">
            <table class="table"ng-table="tableparams" border="0" width="100%" cellpadding="0" cellspacing="0"
                   template-pagination="custom/pager" >
                <tr>
					<td></td>
					<td>{{'RANKING' | translate}}</td>
					<td>{{'DELEGATE' | translate}}</td>
					<td>{{'ADDRESS' | translate}}</td>
					<td>{{'PRODUCTIVITY' | translate}}</td>
					<td>{{'PRODUCED_NUMBER' | translate}}</td>
					<td>{{'APPROVAL' | translate}}</td>
				</tr>
                <tr ng-repeat="i in $data"  >
                    <td><input type="checkbox" ng-disabled="i.voted" ng-checked="i.voted || (i.username | saveCheckfilter)" ng-click="checkitem(i)"></td>
                    <td> {{i.rate }}</td>
                    <td>{{i.username}}</td>
                    <td><i class="level" ng-click="showaccountdetailInfo(i.address)">{{i.address}}</i></td>
                    <td>{{i.productivity}}%</td>
                    <td>{{i.producedblocks}}</td>
                    <td>{{i.approval}}%</td>
                </tr>
            </table>
        </div>
    </div>

    <div class="content third" ng-show="mgvotecord">
        <div class="innerheader">
            <span translate="TOTAL_PEOPLES" translate-values="{ count: myvoteCount }"></span>
            <button class="delete" ng-click="votetoShowInfo(1)">{{'DELETE' | translate}}</button>
        </div>
        <div class="tablewrap">
            <table class="table"ng-table="tableparams2" border="0" width="100%" cellpadding="0" cellspacing="0"
                   template-pagination="custom/pager" >
                <tr>
					<td></td>
					<td>{{'RANKING' | translate}}</td>
					<td>{{'DELEGATE' | translate}}</td>
					<td>{{'ADDRESS' | translate}}</td>
					<td>{{'PRODUCTIVITY' | translate}}</td>
					<td>{{'PRODUCED_NUMBER' | translate}}</td>
					<td>{{'APPROVAL' | translate}}</td>
				</tr>
                <tr ng-repeat="i in $data"  >
                    <td><input type="checkbox" ng-checked="(i.username | saveCodeFilter )" ng-click="checkitem2(i)"></td>
                    <td> {{i.rate}}</td>
                    <td>{{i.username}}</td>
                    <td><i class="level" ng-click="showaccountdetailInfo(i.address)">{{i.address}}</i></td>
                    <td>{{i.productivity}}%</td>
                    <td>{{i.producedblocks}}</td>
                    <td>{{i.approval}}%</td>
                </tr>
            </table>
        </div>
    </div>
    <div class="content second" ng-show="hosting">
        <div class="innerheader">
            <span translate="TOTAL_PEOPLES" translate-values="{ count: totalVoter }"></span>
        </div>
        <div class="tablewrap">
            <table class="table"ng-table="tableparams3" border="0" width="100%" cellpadding="0" cellspacing="0"
                   template-pagination="custom/pager" >
                <tr>
					<td>{{'ADDRESS' | translate}}</td>
					<td>{{'USERNAME' | translate}}</td>
					<td>{{'WEIGHT' | translate}}</td>
				</tr>
                <tr ng-repeat="i in $data"  >
                    <td class="level"> {{i.address}}</td>
                    <td>{{i.username}}</td>
                    <td>{{i.weight}}%</td>
                </tr>
            </table>
        </div>
    </div>
    <script type="text/ng-template" id="custom/pager">
        <ul class="pagination ng-table-pagination">
            <li ng-class="{'disabled': !page.active && !page.current, 'active': page.current}" ng-repeat="page in pages" ng-switch="page.type">
                <a ng-switch-when="prev" ng-click="params.page(page.number)" href="">
                    <i class="mdi-hardware-keyboard-arrow-left">{{'PREV_PAGE' | translate}}</i>
                </a>
                <a ng-switch-when="first" ng-click="params.page(page.number)" href="">
                    <span ng-bind="page.number"></span>
                </a>
                <a ng-switch-when="page" ng-click="params.page(page.number)" href="">
                    <span ng-bind="page.number"></span>
                </a>
                <a ng-switch-when="more" ng-click="params.page(page.number)" href="">&#8230;</a>
                <a ng-switch-when="last" ng-click="params.page(page.number)" href="">
                    <span ng-bind="page.number"></span>
                </a>
                <a ng-switch-when="next" ng-click="params.page(page.number)" href="">
                    <i class="mdi-hardware-keyboard-arrow-right">{{'NEXT_PAGE' | translate}}</i>
                </a>
            </li>
        </ul>
    </script>
</div>